#include<bits/stdc++.h>
using namespace std;
int main()
{
	string s;
	cin>>s;
	int len = s.size();
	string t = s;
	reverse(t.begin(), t.end());
	if(t.find("re") == 0 || t.find("yl") == 0)
		len -= 2;
	else if(t.find("gni") == 0)
		len -= 3;
	for(int i = 0;i < len;i++)
		cout<<s[i];
    return 0;
}

